package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysAnswerMapper;
import com.ruoyi.system.domain.SysAnswer;
import com.ruoyi.system.service.ISysAnswerService;

/**
 * 答题Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-19
 */
@Service
public class SysAnswerServiceImpl implements ISysAnswerService 
{
    @Autowired
    private SysAnswerMapper sysAnswerMapper;

    /**
     * 查询答题
     * 
     * @param id 答题主键
     * @return 答题
     */
    @Override
    public SysAnswer selectSysAnswerById(Long id)
    {
        return sysAnswerMapper.selectSysAnswerById(id);
    }

    /**
     * 查询答题列表
     * 
     * @param sysAnswer 答题
     * @return 答题
     */
    @Override
    public List<SysAnswer> selectSysAnswerList(SysAnswer sysAnswer)
    {
        return sysAnswerMapper.selectSysAnswerList(sysAnswer);
    }

    /**
     * 新增答题
     * 
     * @param sysAnswer 答题
     * @return 结果
     */
    @Override
    public int insertSysAnswer(SysAnswer sysAnswer)
    {
        sysAnswer.setCreateTime(DateUtils.getNowDate());
        return sysAnswerMapper.insertSysAnswer(sysAnswer);
    }

    /**
     * 修改答题
     * 
     * @param sysAnswer 答题
     * @return 结果
     */
    @Override
    public int updateSysAnswer(SysAnswer sysAnswer)
    {
        sysAnswer.setUpdateTime(DateUtils.getNowDate());
        return sysAnswerMapper.updateSysAnswer(sysAnswer);
    }

    /**
     * 批量删除答题
     * 
     * @param ids 需要删除的答题主键
     * @return 结果
     */
    @Override
    public int deleteSysAnswerByIds(Long[] ids)
    {
        return sysAnswerMapper.deleteSysAnswerByIds(ids);
    }

    /**
     * 删除答题信息
     * 
     * @param id 答题主键
     * @return 结果
     */
    @Override
    public int deleteSysAnswerById(Long id)
    {
        return sysAnswerMapper.deleteSysAnswerById(id);
    }
}
